from enum import Enum

from src.mode.bean import DuringResult
from src.mode.peripheral.baen import Peripheral
from src.mode.detection.const import ECommMode


class PeripheralDevice(object):

    def create(self, info: Peripheral):
        pass

    def set_link_mode(self, mode_link: ECommMode, timeout: float = 30) -> (bool, str):
        """
        设置链路通讯模式
        :param mode_link: 链路通讯模式枚举
        :param timeout: 超时时间，默认 30s
        :return: (bool, str) -> [1]: True 成功, False 失败; [2]: 执行信息
        """
        pass

    def get_link_mode(self, timeout: float = 30) -> (int | None, str):
        """
        获取链路通讯模式
        :param timeout: 超时时间，默认 30s
        :return: (bool, str) -> [1]: True 成功, False 失败; [2]: 执行信息
        """
        pass



    def get_data(self, param_type: Enum, timeout=60) ->DuringResult:
        """
        获取外围设备数据
        :param param_type: 读取数据类型
        :param timeout:超时时间，默认 60s
        :return: DuringResult.data -> {
            "Value": 目标数据,
        }
        """
        pass

    def set_data(self, param_type: Enum, value, timeout=60) ->DuringResult:
        """
        设置外围设备数据
        :param param_type: 数据类型
        :param value: 值
        :param timeout: 超时时间，默认 60s
        :return: DuringResult.data -> {
        }
        """
        pass